﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Global.Impl.Client;
using System.IO;

namespace Global.Interfaces.Client
{
    [ServiceContract(Namespace = "sMessenger", CallbackContract = typeof(IChat))]
    public interface IChat
    {
        event EventHandlers.NewMessageHandler NewMessage;
        event EventHandlers.JoinChatHandler JoinChat;
        event EventHandlers.LeaveChatHandler LeaveChat;
        event EventHandlers.LogHandler LogReceived;
        event EventHandlers.FileHandler FileReceived;
        event EventHandlers.FileNameHandler FileNameReceived;

        string Log { get; }

        [OperationContract(IsOneWay=true)]
        void Join(string username);

        [OperationContract(IsOneWay = true)]
        void Send(string fromUsername, string msg);

        [OperationContract(IsOneWay = true)]
        void Leave(string username);

        [OperationContract(IsOneWay = true)]
        void SendLog(string log);

        [OperationContract(IsOneWay = true)]
        void SendFile(Stream file);

        [OperationContract(IsOneWay = true)]
        void SendFileName(string username, string filename);
    }

    public interface IChatChannel : IChat, IClientChannel
    {
    }
}
